<div id="content_main">
    <h3>User</h3>
    <hr >
    <div class="user">
        <?php
        if (empty($user)) {
            echo "Tidak ada data user";
        } else {
            ?>
            <?php echo form_open('home/update_user'); ?>
            <?php foreach ($ub as $dt) : ?>
                <label>Username</label><input type="text" name="username" value="<?php echo $dt->username ?>" readonly="readonly"/><br/>
                <label>Akses</label>
                <select name="akses">
                    <option value="admin">Admin</option>
                    <option value="guru">Guru</option>
                    <option value="siswa">Siswa</option>
                </select><br/>
                <label>Status</label>
                <select name="status">
                    <option value="aktip">Aktip</option>
                    <option value="drop out">Drop Out</option>
                    <option value="lulus">Lulus</option>
                </select>
            <?php endforeach; ?>
            <?php echo form_submit('submit', 'Update user'); ?>
            <?php echo form_close(); ?>
            <table>
                <tr>
                    <th> No </th>
                    <th> Username </th>
                    <th> Akses </th>
                    <th> Status </th>
                    <th> Aksi </th>
                </tr>
                <?php
                $no = 1;
                foreach ($user as $valuser):
                    ?>
                    <tr>
                        <td> <?php echo $no; ?> </td>
                        <td> <?php echo $valuser->username; ?> </td>
                        <td> <?php echo $valuser->type; ?> </td>
                        <td> <?php echo $valuser->status; ?> </td>
                        <td><?php echo anchor('home/ubah_user/' . $valuser->id, 'edit') . ' | ' . anchor('home/del_user/' . $valuser->id, 'Hapus'); ?></td>
                    </tr>
                    <?php
                    $no++;
                endforeach;
                ?>
            </table>
            <?php
        }
        ?>
        <?php echo anchor('home/user', 'Back to user'); ?>
    </div>
</div>